    
<h1>Ngày <?php echo $date?></h1>
<table width="100%" class="outer">
    <tr>
        <td class="left">Đặc Biệt</td>
        <td class="right" style="color: #ff0000;"><?php echo $results[0]?></td>
    </tr>
    <tr>
        <td class="left">Giải nhất</td>
        <td class="right"><?php echo $results[1]?></td>
    </tr>
    <tr>
        <td class="left">Giải nhì</td>
        <td class="right">
            <table class="inner">
                <tr>
                    <td><?php echo $results[2]?></td>
                    <td><?php echo $results[3]?></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="left">Giải ba</td>
        <td class="right">
            <table class="inner">
                <tr>
                    <td><?php echo $results[4]?></td>
                    <td width="60%"><?php echo $results[5]?></td>
                    <td><?php echo $results[6]?></td>
                </tr>                
                <tr>
                    <td><?php echo $results[7]?></td>
                    <td><?php echo $results[8]?></td>
                    <td><?php echo $results[9]?></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="left">Giải tư</td>
        <td class="right">
            <table class="inner">
                <tr>
                    <td><?php echo $results[10]?></td>
                    <td><?php echo $results[11]?></td>
                </tr>                
                <tr>
                    <td><?php echo $results[12]?></td>
                    <td><?php echo $results[13]?></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="left">Giải năm</td>
        <td class="right">
            <table class="inner">
                <tr>
                    <td><?php echo $results[14]?></td>
                    <td width="60%"><?php echo $results[15]?></td>
                    <td><?php echo $results[16]?></td>
                </tr>                
                <tr>
                    <td><?php echo $results[17]?></td>
                    <td><?php echo $results[18]?></td>
                    <td><?php echo $results[19]?></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="left">Giải sáu</td>
        <td class="right">
            <table class="inner">
                <tr>
                    <td><?php echo $results[20]?></td>
                    <td width="60%"><?php echo $results[21]?></td>
                    <td><?php echo $results[22]?></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="left">Giải bảy</td>
        <td class="right">
            <table class="inner">
                <tr>
                    <td><?php echo $results[23]?></td>
                    <td><?php echo $results[24]?></td>
                    <td><?php echo $results[25]?></td>
                    <td><?php echo $results[26]?></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<br>
<br>
<h1>Kết quả 2 số cuối <span class="loading"><img src="/files/img/loader_2.gif"/></span></h1>
<table width="100%" class="outer two">
    <tr style="font-weight: normal;">
        <td class="l" style="vertical-align: middle;">Đầu</td>
        <td style="padding: 20px;">Đuôi</td>
    </tr>
    <?php foreach($results2 as $h => $data):?>
    <tr>
        <td class="l" style="vertical-align: middle;"><?php echo $h?></td>
        <td style="padding: 20px;">
            <?php $db_red = FALSE; foreach($data as $i => $num):?>
                <?php $sp = ($i == count($data) - 1) ? '' : ',&nbsp; ';?>
                
                <?php if(!$db_red && $h == $db['dbf'] && $num == $db['dbl']):?>
                    <?php $db_red = TRUE;?>
                    <span style="color: #f00;"><?php echo $num?></span><?php echo $sp?>
                <?php else:?>
                    <?php echo $num?><?php echo $sp?>
                <?php endif?>
                 
            <?php endforeach?>
        </td>
    </tr>
    <?php endforeach;?>
</table>


<?php if(Yii::app()->request->getQuery('test')){
    echo '<pre>DB: ';print_r($db);echo '<pre>';
    echo '<pre>RESULT: ';print_r($results);echo '<pre>';
    echo '<pre>RESULT2: ';print_r($results2);echo '<pre>';die;
    
}?>